[PHP] strtr function OS-reltated problem
Posted
by Casidiablo
on Stack Overflow
See other posts from Stack Overflow
or by Casidiablo
Published on 2010-04-19T17:48:55Z
Indexed on
2010/04/19
17:53 UTC
Read the original article
Hit count: 256
Hello there!
I have this funtion that converts all special chars to uppercase:
function uc_latin1($str) {
if(!defined("LATIN1_UC_CHARS"))
define("LATIN1_UC_CHARS", "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ");
if(!defined("LATIN1_LC_CHARS"))
define("LATIN1_LC_CHARS", "àáâãäåæçèéêëìíîïðñòóôõöøùúûüý");
$str = strtoupper ( strtr ( $str, LATIN1_LC_CHARS, LATIN1_UC_CHARS ) );
return $str;
}
This function works fine in my development PC (which runs Windows XP)... but, when I test it in the production server (running Redhat Linux) it does not uppercase the string. The string is ISO-8859-1 encoded.
How can I make it work in Linux too?
Thanks for reading.
© Stack Overflow or respective owner